const koa = require("koa");
const router = require("koa-router")();
const app = new koa();
const main = require("./model/index.js")
router.get("/",async ctx=>{
    //实现跨域
    ctx.set("Access-Control-Allow-Origin","*")
    var result = await main();
    console.log("8080");
    console.log(result)
    ctx.body = {
        code:200,
        result
    }
})
app.use(router.routes());
app.listen(8080);